<template>
  <div class="profile-match">
    <!-- 导航菜单 -->
    <el-menu
      :default-active="activeMenu"
      class="profile-menu"
      mode="horizontal"
      router
    >
      <el-menu-item index="/home/profile-match">
        <el-icon><Document /></el-icon>
        <span>职位推荐</span>
      </el-menu-item>
      <el-menu-item index="/home/profile-match/career-advice">
        <el-icon><ChatDotRound /></el-icon>
        <span>职业建议</span>
      </el-menu-item>
      <el-menu-item index="/home/profile-match/learning-resources">
        <el-icon><Reading /></el-icon>
        <span>学习资源</span>
      </el-menu-item>
    </el-menu>

    <!-- 子页面内容 -->
    <router-view></router-view>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { Document, ChatDotRound, Reading } from '@element-plus/icons-vue'

const route = useRoute()
const activeMenu = ref(route.path)

onMounted(() => {
  activeMenu.value = route.path
})
</script>

<style scoped>
.profile-match {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 16px;
}

.profile-menu {
  margin-bottom: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 0 24px;
  min-width: 500px;
}

:deep(.el-menu) {
  border-bottom: none;
  background: transparent;
}

:deep(.el-menu-item) {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  height: 48px;
  line-height: 48px;
  border-radius: 8px 8px 0 0;
  margin-right: 8px;
  transition: background 0.2s;
}

:deep(.el-menu-item.is-active) {
  background: transparent;
  color: inherit !important;
  font-weight: bold;
}

:deep(.el-menu-item.is-active) .el-icon,
:deep(.el-menu-item.is-active) span {
  color: inherit !important;
}
</style>